const http = require('http')

let server = http.createServer((req,res)=>{
    /* 
        req.url可以拿到请求的路径。注意路径是从端口号后面开始的
        比如http://localhost:8080/home/index  路径就是/home/index
    */
    let url = req.url
    res.writeHead(200,{'Content-Type':'text/html;charset=utf8'})

    res.write(`
        <div style='font-size:44px'>
            你输入的路径是${url}
        </div>
    `)
    res.end()
})

server.listen(9000,()=>{
    console.log('The server is started successfully');
})